﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NewMessage.aspx.cs" Inherits="WebSite.NewMessage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>新消息</title>
    <link type="text/css" rel="Stylesheet" href="css/common.css" />
    <link type="text/css" rel="Stylesheet" href="css/frame.css" />
    <style type="text/css">
        div.msgitem
        {
            margin-top: 10px;
        }
        div.separline
        {
            background: url(images/NewMessage/separ_line.png) center no-repeat;
            margin: 5px 0;
            height: 5px;
        }
        div.pager
        {
            text-align: center;
            margin-top: 20px;
        }
        div.msgitem .headimg
        {
            border: 2px solid #FFAE18;
            width: 100px;
            height: 100px;
        }
        div.msgitem .msgbody
        {
            display: inline-block;
            padding: 10px 0 0 10px;
            vertical-align: top;
            width: 260px;
        }
    </style>
    <script src="js/jquery-1.7.1.min.js" type="text/javascript"></script>
    <script src="js/baby.js" type="text/javascript"></script>
</head>
<body style="background-image:none">
    <form id="form1" runat="server">
    <div style="background-color: #ffffff; padding: 20px; width: 600px; margin: 0 auto;">
        <% 
            Maticsoft.BLL.CarrefourCover.Baby bll = new Maticsoft.BLL.CarrefourCover.Baby();
            if (shortMessageData != null)
            {
                for (int i = 0; i < shortMessageData.Count; i++)
                {
                    var shortMsg = shortMessageData[i];
                    int srcbabyid = Common.NullableHelper.CastValueType( shortMsg.SendBabyId );
                    var babyModel = bll.GetModel( srcbabyid ) ?? new Maticsoft.Model.CarrefourCover.Baby();
        %>
        <div class="msgitem">
            <div style="display: inline-block">
                <a href="/viewbaby.aspx?babyid=<%=shortMsg.SendBabyId %>" target="_blank">
                    <img class="headimg" src="<%=shortMsg.SendBabyHeadImg %>" alt="" />
                </a>
            </div>
            <div class="msgbody">
                <p>
                    <b>
                        <%= shortMsg.SendBabyName %></b>
                    <%= WebSite.Core.AgeCalcHelper.AgeCalc( babyModel.BabyBirthday ) %>
                    来自<%= babyModel.LiveProvince + babyModel.LiveCity %></p>
                <p>
                    &nbsp;</p>
                <p>
                    [<%= Common.NullableHelper.CastValueType( shortMsg.CreateTime ).ToString("MM-dd HH:mm:ss") %>] <%=shortMsg.MsgContent %></p>
                    <%if (shortMsg.MsgType == 1)
                      { %>
                    <p style="text-align: left;">
                        <a href="javascript:void(0);" onclick="acceptTeam(<%=shortMsg.Id %>);">
                            <img src="images/NewMessage/accept.png" />
                        </a>
                        <a href="javascript:void(0);" onclick="rejectTeam(<%=shortMsg.Id %>);">
                            <img src="images/NewMessage/cancel.png" />
                        </a>
                    </p>
                    <%} %>
            </div>
        </div>
        <% 
                    if (i != shortMessageData.Count - 1)
                    { %>
        <div class="separline">
        </div>
        <%       
                    }
                }
            } %>
        <div class="pager">
            <%
                System.Collections.Generic.Dictionary<string, string> pp = new System.Collections.Generic.Dictionary<string, string>();
            %>
            <%=Shanda.Utility.Common.PaginationHelper.DoPagination(PageIndex, PageSize, RowTotal, "/NewMessage.aspx", pp, false)%>
            <div class="clearfloat">
            </div>
        </div>
    </div>
    </form>
</body>
</html>
